package tungsten.pb.module;
import com.google.protobuf.Message;
import tungsten.base.server.BaseClient;
import tungsten.pb.protocol.*;

public class BaseBattleModule extends Module
{
	public BaseBattleModule()
	{
		super(BattleProto.Req.getDefaultInstance().getParserForType());
	}

	@Override
	protected void onMessage(BaseClient client,Heads.Head head,Message absMsg)
	{
		BattleProto.Req message = (BattleProto.Req) absMsg;
		switch(message.getBodyCase())
		{
			case STARTBATTLE:onStartBattle(client,head,message.getStartBattle());break;
			case ENDBATTLE:onEndBattle(client,head,message.getEndBattle());break;
		}
	}

	protected void onStartBattle(BaseClient client,Heads.Head head,BattleProto.StartBattle startBattle){}
	protected void onEndBattle(BaseClient client,Heads.Head head,BattleProto.EndBattle endBattle){}
}